package com.jt.mapper;

import com.jt.pojo.User;
import org.apache.ibatis.annotations.*;

import java.util.List;

//该Mapper主要测试注解开发
@Mapper
@CacheNamespace     //使用注解的二级缓存
public interface UserAnnoMapper {
    @Select("select * from demo_user")
    List<User> findAll();
    @Select("select * from demo_user where id = #{id}")
    List<User> findUserById(int id);
    @Insert("insert into demo_user values(null,#{name},#{age},#{sex})")
    int insertUser(User user);
    @Update("update demo_user set id= #{id},age = #{age},sex = #{sex} where name = #{name}")
    int updateUser(User user);
    @Delete("delete from demo_user where id = #{id}")
    int deleteUser(User user);
    @Select("select * from demo_user where name = #{name}")
    List<User> findUserByNa(User user);

    List<User> findCache1();
}
